import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

public class CSE2102_lab1_ManNguyen extends JFrame{
	public CSE2102_lab1_ManNguyen() throws IOException{
		setLayout( new BorderLayout());
		JPanel p1 = new JPanel();
	
		p1.setLayout( new GridLayout(4,3));
		for( int i = 1 ;i<=9;i++){
			p1.add(new JButton(""+i));
		}
		p1.add(new JButton(" *"));
		p1.add(new JButton(" 0"));
		p1.add(new JButton(" #"));

		JPanel p2 = new JPanel();
		p2.setLayout( new GridLayout(2,1));
		JButton Call = new JButton(" Call");
		Call.setBackground(Color.GREEN);
		JButton Cancel = new JButton(" Cancel");
		Cancel.setBackground(Color.RED);
		
		p2.add(Call);
		p2.add(Cancel);
		
		JPanel p3 = new JPanel();
		p3.setLayout( new BorderLayout());
		
		p3.add(p1,BorderLayout.CENTER);
		p3.add(p2,BorderLayout.EAST);
		BufferedImage Display = ImageIO.read(new File("image/Display.gif"));
		JLabel picLabel = new JLabel(new ImageIcon( Display ));

	
		picLabel.setSize(400,300);
		add(picLabel,BorderLayout.NORTH);
		add(p3,BorderLayout.CENTER);
		
	}
	public static void main(String[] args) throws IOException{
		CSE2102_lab1_ManNguyen app  = new CSE2102_lab1_ManNguyen();
		app.setTitle("Cell Phone ");
		app.setSize(424, 700);
		app.setLocationRelativeTo(null);
		app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		app.setVisible(true);
	}
}

